package com.ntv.service;

import java.util.List;

import org.apache.log4j.Logger;
import org.junit.Ignore;
import org.springframework.test.AbstractDependencyInjectionSpringContextTests;

import com.ntv.domain.INews;
import com.ntv.domain.INewsType;
import com.ntv.persistent.PersistentException;
import com.ntv.persistent.news.INewsTypeDao;
import com.ntv.service.news.INewsAppService;

public class NewServiceTest extends AbstractDependencyInjectionSpringContextTests
{
	
	private static final Logger logger = Logger.getLogger(NewServiceTest.class);
	
	// specifies the Spring configuration to load for this test fixture
	protected String[] getConfigLocations() 
	{
		return new String[] { "classpath:nammatv.spring.service.xml" , "classpath:nammatv.spring.data.xml" };
	}
	

	public void testNewsTypeList() 
	{
		INewsTypeDao newstypedao = (INewsTypeDao)getApplicationContext().getBean("newsTypeDao");
		try 
		{
			logger.info("newstypedao " + 1);
			
			List<INewsType> newsTypeList = newstypedao.getNewsTypes();
			
			logger.info("newstypedao " + 2 );
			for (INewsType newstype : newsTypeList) 
			{
				logger.info("NEWS " + newstype);
			}			
			logger.info("newstypedao " + 3);
		} catch (PersistentException e) 
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
